package com.cjg.useClass;

import java.util.concurrent.CountDownLatch;

public class demo0 {
    public static void main(String[] args) throws InterruptedException {
        CountDownLatch countDownLatch = new CountDownLatch(5);

        for (int i = 0; i <5 ; i++) {
            new Thread(()->{
                System.out.println(Thread.currentThread().getName()+":go");
                countDownLatch.countDown(); //数量减一

            }).start();

        }
        countDownLatch.await(); //等待归零,执行下一步
        System.out.println("Fuck");
    }
}
